package com.alameda.controller.v1.video;

import com.alameda.common.result.Result;
import com.alameda.service.video.ApVideoService;
import com.alameda.video.dto.ApVideoDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 移动端视频模块 前端控制层
 *
 * @author Lv
 * @date 2024/09/22
 */
@Api(tags = "移动端视频")
@RestController
@RequestMapping("/ap_video")
public class ApVideoController {

    @Autowired
    private ApVideoService apVideoService;

    /**
     * 查询视频列表
     *
     * @param apVideoDTO 移动端视频信息
     * @return
     */
    @ApiOperation("查询视频列表")
    @PostMapping("/load_video")
    public Result<?> loadVideo(@RequestBody ApVideoDTO apVideoDTO) {
        return Result.success(apVideoService.loadVideo(apVideoDTO));
    }

    /**
     * 查询视频
     *
     * @param apVideoDTO 移动端视频信息
     * @return
     */
    @ApiOperation("查询视频")
    @PostMapping("/find")
    public Result<?> findById(@RequestBody ApVideoDTO apVideoDTO) {
        return Result.success(apVideoService.findById(apVideoDTO));
    }

    /**
     * 查询视频播放页面列表视频
     *
     * @param apVideoDTO 移动端视频信息
     * @return
     */
    @ApiOperation("查询视频播放页面列表视频")
    @PostMapping("/find_video_detail_info")
    public Result<?> findVideoDetailInfo(@RequestBody ApVideoDTO apVideoDTO) {
        return Result.success(apVideoService.findVideoDetailInfo(apVideoDTO));
    }
}
